import  os

all_ = os.listdir('all_img')

count = 0
for i in all_:
    filename = os.path.join('all_img', i)
    new_name = os.path.join('all_img', '{}.jpg'.format(count))
    #print(filename, new_name)
    os.rename(filename, new_name)

    filename = os.path.join('all_xml', i[:-3]+'xml')
    new_name = os.path.join('all_xml', '{}.xml'.format(count))
    #print(filename, new_name)
    #input("!!")
    os.rename(filename, new_name)

    count+=1
